﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JingQiao.Ads.Infrastructure.Data.LinqToSql.Repository
{
    using Domain.Model;
    using Domain.Model.DomainObject;
    using Domain.Model.Repository;

    public class PositionRepository : BaseRepository<IPosition>, IPositionRepository
    {
        public PositionRepository(IContext context)
            : base(context)
        {
        }

        public override void Add(IPosition entity)
        {
            Check.Argument.IsNotNull(entity, "entity");

            //if (this._context.Position.Any(p => p.UniqueCode == entity.UniqueCode))
            //{
            //    throw new ArgumentException("\"{0}\" Position with the same UniqueCode already exits. Specifiy a diffrent UniqueCode.".FormatWith(entity.UniqueCode), "entity");
            //}

            base.Add(entity);
        }

        public bool IsHasAdvertisement(int positionId)
        {
            return false;
        }

        public IPosition FindById(int id)
        {
            Check.Argument.IsNotNegativeOrZero(id, "id");
            return null;
        }

        public IQueryable<IPosition> FindByIds(string positions)
        {
            return null;
        }

        public IQueryable<IPosition> FindAll()
        {
            return null;
        }

        public PagedResult<IPosition> FindAll(int pageSize, int pageIndex)
        {
            return null;
        }

        public PagedResult<IPosition> FindByUniqueCode(int pageSize, int pageIndex, string uniqueCode)
        {
            return null;
        }

        public int CountAll()
        {
            return 0;
        }

        public PagedResult<IPosition> FindByName(int pageSize, int pageIndex, string name)
        {
            return null;
        }

        public int CountByName(string name)
        {
            return 0;
        }
    }
}
